package com.lemon.service.impl;

import com.lemon.entity.Book;
import com.lemon.mapper.BookMapper;
import com.lemon.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {

    private final BookMapper boookMapper;

    @Autowired
    public BookServiceImpl(BookMapper bookMapper){
        this.boookMapper = bookMapper;
    }


    @Override
    public List<Book> queryBookForList() {
        return  this.boookMapper.queryBookForList();
    }

    @Override
    public Book selectBookById(Integer id) {
        return this.boookMapper.selectBookById(id);
    }

    @Override
    public int insertBook(Book book) {
        return this.boookMapper.insertBook(book);
    }

    @Override
    public int deleteBook(Integer id) {
        return this.boookMapper.deleteBook(id);
    }

    @Override
    public int updateBook(Book book) {
        return this.boookMapper.updateBook(book);
    }
}
